home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 48 / Amiga Format CD48 (1999-12-13)(Future Publishing)(GB)(Track 1 of 2)[!][issue 2000-01].iso / -websites- / whdload / games / rotor.lha / RotorHD / Install next >
Text File  |  2000-06-29  |  3KB  |  169 lines

  1. ;****************************
  2. (set #sub-dir "data")
  3. (set #readme-file "Rotor.readme")    ;name of readme file
  4. (set #last-file "STY")    ;last file the imager should create
  5.  
  6. ;****************************
  7. ;----------------------------
  8. ; Checks if given program is reachable via the path
  9. ; if not abort install
  10. ; IN:  #program - to check
  11. ; OUT: -
  12.  
  13. (procedure P_chkrun
  14.   (if
  15.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  16.     ("")
  17.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  18.   )
  19. )
  20.  
  21. ;****************************
  22.  
  23. (if
  24.   (exists #readme-file)
  25.   (if 
  26.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  27.     ("")
  28.     (run ("SYS:Utilities/More %s" #readme-file))
  29.   )
  30. )
  31.  
  32. (set #program "WHDLoad")
  33. (P_chkrun)
  34.  
  35. (set #program "RawDIC")
  36. (P_chkrun)
  37.  
  38. (if
  39.   (= @user-level 2)
  40.   (
  41.     (set #CI_drive
  42.       (askchoice
  43.     (prompt "Select source drive for diskimages")
  44.     (default 0)
  45.     (choices "DF0:" "DF1:" "DF2:" "DF3:")
  46.     (help @askchoice-help)
  47.       )
  48.     )
  49.     (select #CI_drive
  50.       (set #CI_drive "DF0:")
  51.       (set #CI_drive "DF1:")
  52.       (set #CI_drive "DF2:")
  53.       (set #CI_drive "DF3:")
  54.     )
  55.   )
  56.   (set #CI_drive "DF0:")
  57. )
  58.  
  59. (set @default-dest
  60.   (askdir
  61.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  62.     (help @askdir-help)
  63.     (default @default-dest)
  64.     (disk)
  65.   )
  66. )
  67. (set #dest (tackon @default-dest @app-name))
  68. (if
  69.   (exists #dest)
  70.   (
  71.     (set #choice
  72.       (askbool
  73.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  74.         (default 1)
  75.         (choices "Delete" "Skip")
  76.         (help @askbool-help)
  77.       )
  78.     )
  79.     (if
  80.       (= #choice 1)
  81.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  82.     )
  83.   )
  84. )
  85.  
  86. (makedir #dest
  87.   (help @makedir-help)
  88.   (infos)
  89. )
  90.  
  91.  
  92. ;----------------------------
  93.  
  94. (if
  95.   (exists ("%s.newicon" @app-name))
  96.   (set #icon
  97.     (askchoice
  98.       (prompt "\nWhich icon do you like to install ?\n")
  99.       (default 0)
  100.       (choices "Normal" "NewIcon")
  101.       (help @askchoice-help)
  102.     )
  103.   )
  104.   (set #icon 0)
  105. )
  106. (select #icon
  107.   (set #icon ("%s.inf" @app-name))
  108.   (set #icon ("%s.newicon" @app-name))
  109. )
  110. (copyfiles
  111.   (help @copyfiles-help)
  112.   (source #icon)
  113.   (newname ("%s.info" @app-name))
  114.   (dest #dest)
  115. )
  116. (copyfiles
  117.   (help @copyfiles-help)
  118.   (source ("%s.slave" @app-name ))
  119.   (dest #dest)
  120. )
  121. (if
  122.   (exists #readme-file)
  123.   (copyfiles
  124.     (help @copyfiles-help)
  125.     (source #readme-file)
  126.     (dest #dest)
  127.   )
  128. )
  129. (if
  130.   (exists ("%s.info" #readme-file))
  131.   (copyfiles
  132.     (help @copyfiles-help)
  133.     (source ("%s.info" #readme-file))
  134.     (dest #dest)
  135.   )
  136. )
  137.  
  138. (if
  139.   (= #sub-dir "")
  140.   ("")
  141.   (
  142.     (set #dest (tackon #dest #sub-dir))
  143.     (makedir #dest
  144.       (help @makedir-help)
  145.     )
  146.   )
  147. )
  148.  
  149. (copyfiles
  150.   (help @copyfiles-help)
  151.   (source ("%s.islave" @app-name))
  152.   (dest #dest)
  153. )
  154.  
  155. (working)
  156. (run ("CD \"%s\"\nRawDIC SLAVE=%s.islave SOURCE=%s\nDelete %s.islave" #dest @app-name #CI_drive @app-name))
  157.  
  158. (if
  159.   (exists (tackon #dest #last-file))
  160.   ("")
  161.   (abort "Diskimaging not successful !\nRawDIC was unable to create all needed files !")
  162. )
  163.  
  164. ;----------------------------
  165.  
  166. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  167.  
  168. (exit)
  169.